package com.alex.designPattern.flyWeight;

import java.util.ArrayList;
import java.util.List;

public class CoffeeShop {
	
	List<CoffeeOrder> orders = new ArrayList<CoffeeOrder>();
	
	CoffeeFactory coffeeFac = new CoffeeFactory();
	
	public void addOrder(int tableNum,String coffeeType) {
		orders.add(new CoffeeOrder(coffeeType, tableNum));
	}
	
	
	public void serveCoffee() {
		for(CoffeeOrder order : orders) {
			Coffee coffee = coffeeFac.getCoffee(order.getCoffeeType());
			System.out.println("Server table:" + order.getTableNum() + ",coffee:" + coffee.getType());
		}
	}
	
	public void printCoffee() {
		System.out.println(coffeeFac.getContext());
	}
}
